package yt.kpool.view.dialog;

import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import yt.kpool.R;
import yt.kpool.util.DisplayUtil;

public class StopPayDialog extends Dialog {
    private TextView btn_cancel, btn_update;
    private Activity context;
    private TextView tv_content;
    private String content;



    public StopPayDialog(Activity context, int theme, String content) {
        super(context, theme);
        this.context = context;
        this.content = content;

    }

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LayoutInflater inflater = LayoutInflater.from(getContext());
        View view = inflater.inflate(R.layout.dialog_stoppay, null);
        setContentView(view, new ViewGroup.LayoutParams(DisplayUtil.getWidthPixels(context) / 2 + 150,
                ViewGroup.LayoutParams.WRAP_CONTENT));
        btn_cancel =  view.findViewById(R.id.btn_cancel);
        btn_update =  view.findViewById(R.id.btn_update);
        tv_content =  view.findViewById(R.id.tv_content);
        tv_content.setText(content);
        btn_cancel.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();


            }
        });
        btn_update.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();
                //UpdateActivity.start(context, url);



            }
        });


    }

}
